﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IFServerDLL.Model
{
    public class MyVariety
    {
        static MyVariety()
        {
            MyVariety varIF = new MyVariety("IF", 0.2m, 1,300);
            ListVariety.Add(varIF);
        }
        private static List<MyVariety> ListVariety = new List<MyVariety>();
        public static MyVariety GetVarietyByInstrument(string instrument)
        {
            return ListVariety.Where(p => instrument.StartsWith(p.Name)).FirstOrDefault();
        }
        public MyVariety(string name, decimal onePrice,int pricePoint,int count)
        {
            _name = name;
            _oneChangedPrice = onePrice;
            _PriceFormat = "n" + pricePoint;
            _count = count;
        }
        private string _name;
        public string Name { get { return _name; } }
        private decimal _oneChangedPrice;
        public decimal OneChangedPrice { get { return _oneChangedPrice; } }
        private string _PriceFormat;
        public string PriceFormat { get { return _PriceFormat; } }
        private int _count;
        public int Count { get { return _count; } }
    }
}
